<script>
   function submit(){
      $('input#timestamp').val(new Date().getTime())
      $.ajax({
         type: "POST",
         url: "/chirping/",
         data: $('#chirping_form').serialize(),
         success: function (result) {
            window.location = '/chirpings'
         },
         error : function() {
         }
      });
   }
window.onload = function(){
   $('button#submit').on('click', function(){
      submit();
   });
   menu = $('ul.nav>li.chirping');
   menu.addClass('active');
   menu_link = $('ul.nav>li.chirping>a');
   menu_link.attr('href', '#');
}

</script>
